package com.yang.service;

import com.yang.entity.User;
import com.yang.dao.UserDao;

import java.util.*;

public class UserService {
    private final UserDao userDao = new UserDao();

    //查询全部
    public List<User> queryUser() {
        return userDao.queryUser();
    }

    //单个查询
    public User queryUserById(Integer id) {
        return userDao.queryUserById(id);
    }

    //添加
    public int saveUser(User obj) {
        return userDao.saveUser(obj);
    }

    //删除
    public int deleteUserById(Integer id) {
        return userDao.deleteUserById(id);
    }

    //修改
    public int updateUserById(User obj) {
        return userDao.updateUserById(obj);
    }
}
